Trying to pass an advanced function as a function argument in Powershell